<template>
  <div class="common-search">
    <van-search placeholder="请输入搜索关键词" v-model="content" @search="getList" @blur="getList" @clear="getList" background="#00998d"/>
  </div>
</template>
<script>
export default {
  props:["search"],
  components:{
  },
  name: "",
  data () {
    return {
      content:"",//搜索的内容
      settime:null,//搜索防抖
    };
  },
   methods:{
     getList(){
       clearTimeout(this.settime)
       this.settime=setTimeout(()=>{
         this.search.search=this.content
         this.$emit('new_search')
       },100)
     }
  },
   created(){
  }
}
</script>
<style lang="scss" scoped>
.common-search{
  
}
</style>